/********************************
Creat Object: Object.create()
*/

var personProto = {
    calculateAge: function() {
        console.log(2018 - this.yearOfBirth);
    }
};

var john = Object.create(personProto);
john.yearOfBirth = 1990;

var jane = Object.create(personProto, 
    {
        yearOfBirth: { value: 1991 },
        name: { value: 'Jane' }
    }
);

console.log(john.calculateAge === jane.calculateAge);       // true


